import { instantiate } from 'cc';
import { Singleton } from '../../Base/Singleton';
import { GameClone } from '../../Interfaces/IGameClone';
import { UIData } from './base/UIData';
import { UIBase } from './UIBase';
import { UIComponentProxyManager } from './UIComponentProxyManager';

export abstract class UIComponent extends UIBase{
    private isEffective : boolean = true;
    // 并不是Update机制，这里只是上层通知这个component要更新了。
    public abstract OnUpdateComponent(oData : UIData);
    public OnDestroySelf(){
       this.OnDestroy();
    }

    public SetEffective(isEffective : boolean)
    {
        this.isEffective = isEffective;
        if(this.uiNode != null)
        {
            this.uiNode.active = isEffective;
        }
    }
}